All right, So let's start scripting our eruption on our lava.
So let's go to lava and then the lava pool.
Is that part right in here?
I'm going to duplicate it.
I'm going to take control D with collisions off so that it duplicates in place.
The reason I'm doing this is because I'm going to have the flow drain down and I want to keep the pool
there.
Right?
So I'm going to get rid of the sound on the second Liverpool so we don't need it.
And then I'm going to call the second lava pool lava flow.
I'll make a capital lava flow.
There we go.
So one's going to move, one is going to stay still.
I'm going to go to Lava.
Open that.
Hit that plus sign out a script.
I'm going to call this abrupt.
Maybe I'll call this eruption.
There we go.
All right, Now, I got to get a reference to my lava flow.
So local.
I'll call it lava.
Script Dot Parent.
Oh, and then we have to go down one.
Let's see.
Script dot, parent.
And then we'll have lava flow.
I need a function, a local function, a call that erupt.
And then we're going to do a for loop.
We could do this twinning, and I'm going to introduce tweeting in more detail later, but we're going
to use a for loop.
But this it'll work fine for I equals one to let's say we'll go 80 and steps of one do let's increase
the size of our lava flow.
So let's say lava size equals lava dot size plus what we want to add to it on each iteration of the
loop, I'm going to do vector three new.
The height is the ex.
Remember we rotated the cylinder.
So that's a little bit weird, right?
So this is the height I'm going to make it.
0.03 is not going to increase much every loop iteration, but I am going to increase the X and the Z,
right?
It's actually the Y and the Z on the part, but X in the Z in the world space and I just played around
with it until I got that right.
Right.
So don't worry if you're like, Oh my gosh, how am I supposed to know that, right?
Just play with it and you'll get it.
So I'll do a weight point one second in between each loop iteration.
This is going to expand my lava out on the X and Z much faster than the height.
So let's do a way to get in the world to see it.
We'll do like 8 seconds and then we'll do an abrupt Let's try.
And we'll look for errors down here.
Output.
There we go.
It's expanding.
It's looking good.
It's slowly increasing.
Yeah, not bad.
It's going to stay there.
We have to drain it off now.
So in the next video, I'll do the drain.